package com.siyuanren.gcocp.enumm;

import lombok.Getter;

/**
 * Created by   anxing
 * Project_name gcocp-parent
 * Path         com.siyuanren.gcocp.enumm
 * Date         2018/7/4
 * Time         14:14
 * Description 章节音视频类型
 */
@Getter
public enum VideoTypeEnum {
    Audio("音频", 0),
    Video("视频", 1),
    AudioVideo("音视频", 2);

    private String desc;
    private int value;


    VideoTypeEnum(String desc, int value) {
        this.desc = desc;
        this.value = value;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public void setValue(int value) {
        this.value = value;
    }

    /**
     * 返回描述
     * @param videoType
     * @return
     */
    public static String getDesc(Integer videoType) {
        for (VideoTypeEnum videoTypeEnum : VideoTypeEnum.values()) {
            if (videoTypeEnum.getValue() == videoType) {
                return videoTypeEnum.getDesc();
            }
        }
        return null;
    }
}
